Dashboard

Column

Barplot

Volcanoplot

Table

Summary

   Feature                Type        Value          Statistic        
 Length:32          Shuffled:16   Min.   :  1.470   Length:32         
 Class :character   True    :16   1st Qu.:  8.335   Class :character  
 Mode  :character                 Median : 25.280   Mode  :character  
                                  Mean   : 43.679                     
                                  3rd Qu.: 41.750                     
                                  Max.   :163.000                     
    Variance          Pval_1            Pval_2            Neg_binom     
 Min.   :0.0000   Min.   :0.006421   Length:32          Min.   :0.3648  
 1st Qu.:0.7922   1st Qu.:0.017490   Class :character   1st Qu.:0.6351  
 Median :1.9105   Median :0.042335   Mode  :character   Median :0.7916  
 Mean   :3.0135   Mean   :0.182976                      Mean   :0.7125  
 3rd Qu.:5.4399   3rd Qu.:0.390275                      3rd Qu.:0.8072  
 Max.   :8.4546   Max.   :0.479200                      Max.   :0.8488  
---
title: "Web-OLOGRAM"
output: 
  flexdashboard::flex_dashboard:
    source_code: embed
    orientaion: columns
    theme: bootstrap
params:
  barplot_table: NULL
  volcano_table: NULL
---

```{css}
.chart-shim {
  overflow: auto;
}
```
    
```{r global, include = FALSE}
knitr::opts_chunk$set(echo = FALSE)
#--------------------------------------------------------------
# Load libraries
#--------------------------------------------------------------

# library(shiny)
library(reshape2)
library(ggplot2)
library(dplyr)
library(ggrepel)
library(ggthemes)
library(shinythemes)
library(optparse)
library(plotly)
library(DT)
library(crosstalk)
library(htmltools)
head(params$barplot_table)

```

Dashboard 
=======================================================================

Inputs {.sidebar}
-----------------------------------------------------------------------

### Inputs

```{r}
sd_barplot_table <- SharedData$new(params$barplot_table)
sd_volcano_table <- SharedData$new(params$volcano_table)

filter_slider("value", "Value", sd_barplot_table, column=~Value, step=1000)

```

Column {.tabset}
-----------------------------------------------------------------------

### Barplot 

```{r}
bar <- ggplot(sd_barplot_table, mapping=aes(x=Feature, y=Value, fill=Type)) + 
         geom_bar(stat="identity", position = "dodge") 
bar_ly <- ggplotly(bar)
bscols(bar_ly,device = c("xs", "sm", "md", "lg"))
```

### Volcanoplot

```{r}
volcano <-  ggplot(params$volcano_table, 
           mapping=aes(x=.data[['log2(FC)']],
                      y=.data[['-log10(pvalue)']],
                      color=.data[['Statistic']],
                      label=.data[['Feature']])) +
      geom_vline(xintercept = 0,
                 size=0.5) +
      geom_hline(yintercept = 0,
                 size=0.5) +
      geom_point() +
      geom_label()
volcano_y <- ggplotly(volcano)
volcano_y

```

### Table 

```{r}
DT::datatable(params$barplot_table,
              options = list(bPaginate = FALSE))
```

### Summary 

```{r}
summary(params$barplot_table)
```